import type { App } from 'vue'
import { Pane, Splitpanes } from 'splitpanes'
import VXETable from 'vxe-table'
import VuePluginHiPrint, {
    defaultElementTypeProvider,
    hiprint,
    hiPrintPlugin
} from 'vue-plugin-hiprint'

/**
 * 加载第三方库
 * @param app
 */
export default function setupThirdLibs(app: App) {
    app.component('Splitpanes', Splitpanes)
    app.component('Pane', Pane)
    app.use(VXETable)
    app.use(VuePluginHiPrint)
    //hiprint初始化
    hiprint.init({
        providers: [defaultElementTypeProvider()]
    })
    //如果不启用hiprint 客户端打印，就关掉这个，可以防止控制台一直报错
    app.use(
        hiPrintPlugin,
        '$hiprint',
        import.meta.env.VITE_HIPRINT_CLIENT_ENABLE == 'true'
    )
}
